const router = require('koa-router')()
const userApiCon = require('../controller/userApiController')
const tokenCheck = require('../middlewares/auth')



router.prefix('/apis/users')

router.post('/getUserToken',userApiCon.getUserTokenByLogin)

router.all('*',tokenCheck.tokenCheck)

router.get('/roles',userApiCon.getAllRoles)

router.post('/users',userApiCon.getSearchUserManage)

router.post('/adduser',userApiCon.addUser)

router.delete('/deleteuser/:userNum',userApiCon.deleteUser)

router.put('/updateuser',userApiCon.updateUser)

router.post('/userLogin',userApiCon.getUserLogin)

router.get('/userInfo/:userNum',userApiCon.getUserInfoByUserno)



module.exports = router